

<!DOCTYPE html>
<html>
	<head>
		<title>云盘资源共享站</title>
		<meta charset="utf-8">
		<script src="js/axios.js"></script>
		<script>
			function format(str, args) {
				return str.replace(/{(\d+)}/g, (match, index) => args[index]);
			}

			function sendRequest() {
				let inputStr = document.getElementById("inputText").value;
				let mode = document.getElementById("mode").value;
				let token = document.getElementById("token").value;
				let cookie = document.getElementById("cookie").value;
				const lines = inputStr.split('\n'); // 按行分割文本
				let index = 0
				let headers = {
					'Cookie': cookie,
					'X-Csrf-Token': token,
					'Sec-Ch-Ua-Platform': 'Windows',
					'Referer': 'https://yunpan1.cc/u/23761',
					'Origin':'https://yunpan1.cc'
				}

				console.log('inputStr', inputStr, token, cookie, lines.length)

				function requestRoll() {
					console.log('requestRoll', index,lines[index],lines[index].split(','))
					if (index < lines.length&&lines[index]) {
						const arr = lines[index].split(',')
						const data = JSON.parse(format(mode,arr))
						console.log(data)
						axios.post('https://fc-mp-45004f13-e190-4608-8f1f-968551d365c9.next.bspapp.com/auto', {
							data: data,
							url: 'https://yunpan1.cc/api/discussions',
							headers: headers
						}).then(res => {
							console.log(res)
						}).catch(err => {
							console.error(lines[index])
							console.log(err)
						}).finally(() => {
							setTimeout(() => {
								index++
								requestRoll()
							}, 30000)
						})
					}
				}
				requestRoll()
			}
			const modeData = {
				"data": {
					"type": "discussions",
					"attributes": {
						"title": `【每日短剧】【夸克】{0} 附短剧集合`,
						"content": `{0}\n{1}\n\n【防丢链接，保存不失联】\nhttps://link3.cc/lzero\n（短剧猫自助搜剧，点击加入⬆️⬆️⬆️）\n\n更多精彩\n6000+短剧合集：https://sourl.cn/BGVGAS\n2024短剧夸克：https://sourl.cn/tGTGuW\n\n合集转存：https://pan.xunlei.com/s/VNtQ9H8ECYBLoaAxC1gH4P87A1?pwd=8tyu`
					},
					"relationships": {
						"tags": {
							"data": [{
								"type": "tags",
								"id": "17"
							}, {
								"type": "tags",
								"id": "20"
							}]
						}
					}
				}
			}
			setTimeout(()=>{
				document.getElementById("mode").value = JSON.stringify(modeData)
			},500)
		</script>
	</head>
	<body>
		<textarea id="token" cols="50" style="min-height: 50px;" placeholder="token"></textarea>
		<textarea id="cookie" cols="50" style="min-height: 50px;" placeholder="cookie"></textarea>
		<br>
		<textarea id="inputText" cols="100" style="min-height: 150px;"></textarea>
		<br>
		<button onclick="sendRequest()">发送</button>
		<br>
		<textarea id="mode" cols="100" style="min-height: 150px;"></textarea>
	</body>
</html>